package com.ruoyi.system.telMsg.controller;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.V2.inter.mapper.SalePartnerMapper;
import com.ruoyi.system.V2.phone.service.ITelManageService;
import com.ruoyi.system.model.domain.SalePartner;
import com.ruoyi.system.model.domain.TelManage;
import com.ruoyi.system.outto.goods.impl.ApiSmsService;
import com.ruoyi.system.telMsg.domain.TelCallBackReq;
import com.ruoyi.system.telMsg.domain.TelSendMsg;
import com.ruoyi.system.telMsg.service.ITelSendMsgService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @other pzz
 * @data 2025/3/12
 * @apiNote
 */
//@RequestMapping("/report")
@RestController
public class TelManageCallBackController {

    @Autowired
    private ITelSendMsgService telSendMsgService;
    @Autowired
    SalePartnerMapper salePartnerMapper;

    @Autowired
    ApiSmsService apiSmsService;


//    @PostMapping("/msg")
    public AjaxResult msg(@RequestBody TelCallBackReq req) {

        TelSendMsg msg = new TelSendMsg();
        msg.setCreateId(1L);
        msg.setCreateName("系统");
        msg.setN(req.getFrom());
        msg.setTo(req.getN());
        msg.setTxt(req.getTxt());
        msg.setType("2");
        msg.setCode("200");
        telSendMsgService.insertTelSendMsg(msg);

        return AjaxResult.success();
    }
}
